package route

import "github.com/kataras/iris/v12"

func WebsiteRoute(api *iris.Application) {
	api.RegisterView(iris.HTML("./wwwroot", ".html"))
	api.HandleDir("/assets", "./wwwroot/assets")
	api.Favicon("/vite.svg", "./wwwroot/vite.svg")
	api.OnErrorCode(iris.StatusNotFound, func(ctx iris.Context) {
		ctx.StatusCode(200)
		ctx.View("index.html")

	})
	api.Get("/", func(ctx iris.Context) {
		ctx.View("index.html")
	})
}
